laravel check record exists

55

laravel check record exists -

$user = User::where('email', '=', Input::get('email'))->first();
if ($user === null) {
   // user doesn't exist
}

if notexists in laravel query -

if (User::where('email', '=', Input::get('email'))->exists()) {
   // user found
}

Comments

Submit
0 Comments